#define DEFAULT_CAPACITY 20
class ArrayList:public Object{

public:

  int count;

  String elementData[DEFAULT_CAPACITY];


  ArrayList(){

    count=0;
  }

  void add(String str){

    
    elementData[count++] = str;


  }

  void add(char* str){

      add(String(str));
  }
 
  int size(){

    return count;
  }
  void printAll(){
	int i=0;
    int n=count;
    for(i=0;i<n;i++){

        printf("index: %d value: %s\n",i,elementData[i].toString());

    }

  }

  String get(int index){

    if(index < 0 || index >= count){

      new Exception("sorry index is out of bound");
    }

    return  elementData[index];
  }

  void clear(){

    for(int i=0; i < count;i++ ){

      elementData[i]="";
    }
    count =0;
  }






};